/**
 * 
 */
package com.youth.fund.hk.hostManager.manager.dao.mybatis;

import java.sql.Timestamp;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.youth.fund.hk.hostManager.common.dao.mybatis.BaseMybatisDao;
import com.youth.fund.hk.hostManager.manager.dao.ContactInformationDao;
import com.youth.fund.hk.hostManager.manager.datamodel.ContactInformationModel;

/**
 * @author Sunk_Sky
 *
 *         2014年12月2日下午10:28:12
 */
@Repository("ContactInformationDao")
public class ContactInformationMybatisDaoImpl extends
		BaseMybatisDao<ContactInformationModel, Integer> implements
		ContactInformationDao
{
	private final static String CREATE = "contact_information.create";

	private final static String DELETE = "contact_information.delete";

	private final static String UPDATE = "contact_information.update";

	private final static String QUERY_BY_CONDITION = "contact_information.list_by_condition";

	@Override
	public boolean create(ContactInformationModel model)
	{
		Timestamp timestamp = new Timestamp(System.currentTimeMillis());

		model.setSetup_time(timestamp);

		model.setUpdate_time(timestamp);

		return super.create(model, CREATE);
	}

	@Override
	public boolean delete(ContactInformationModel model)
	{
		return super.delete(model, DELETE);
	}

	@Override
	public boolean update(ContactInformationModel model)
	{
		Timestamp timestamp = new Timestamp(System.currentTimeMillis());

		model.setUpdate_time(timestamp);

		return super.update(model, UPDATE);
	}

	@Override
	public List<ContactInformationModel> query(ContactInformationModel model)
	{
		return super.query(model, QUERY_BY_CONDITION);
	}

	@Override
	public ContactInformationModel queryOne(ContactInformationModel model)
	{
		return super.queryOne(model, QUERY_BY_CONDITION);
	}

}
